class Data{
    public  int  number;
    public void add(){
        number++;
    }
}

public class test2Sync {

    public static void main(String[] args) {
        Data data = new Data();
        for(int i = 0; i <10;i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    for(int j =0 ; j < 2000 ; j++) {
                        data.add();
                    }
                }
            },String.valueOf(i)).start();
          /*  while(Thread.activeCount() >= 2){
                Thread.yield();
            }*/
            System.out.println("Number");
            System.out.println(data.number);

        }
    }
}

